package pattern.creational.factorymethod.simple;

/**
 * @author: chaoyang.ren
 * @date:Jul 13, 2017
 * @time:2:36:03 PM
 * @email:chaoyang.ren@foxmail.com
 * @version: 1.0
 */
public class SendFactory {
	public Sender produce(String type) {
		if ("mail".equals(type)) {
			return new MailSender();
		} else if ("sms".equals(type)) {
			return new SmsSender();
		} else {
			System.out.println("请输入正确的类型!");
			return null;
		}
	}
}
